# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=time
pkgver=1.9
pkgrel=1
pkgdesc="Utility for monitoring a program's use of system resources"
depends=('msys2-runtime')
makedepends=('gcc')
groups=('base')
url='https://www.gnu.org/directory/time.html'
license=('GPL')
arch=('i686' 'x86_64')
intall=time.install
source=(https://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
        time-1.9-msysize.patch)
sha256sums=('fbacf0c81e62429df3e33bda4cee38756604f18e01d977338e23306a3e3b521e'
            '1b33fa8b18f9768af2ab830e804e5ecd30b902572525db52af191ff82ebd47bc')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -p1 -i ${srcdir}/time-1.9-msysize.patch
  autoreconf -fisv
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
    --prefix=/usr \
    --infodir=/usr/share/info \
    --build=${CHOST}
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
}
